<template>
    <div>
        <button v-show="leftShow">{{ left }}</button>
        navbar---{{ myTitle }}
        <button v-show="rightShow">{{ right }}</button>
    </div>
</template>

<script>

export default {
    // props: ["myTitle", "left", "right", "leftShow", "rightShow"],
    props: {
        //简写形式
        myTitle: String,
        // 多个类型校验
        left: [String, Number],
        right: {
            // 必传校验
            required: true,
            // 传入值校验
            validator(value) {
                return ['success', 'warning', 'danger'].includes(value)
            }
        },
        leftShow: {
            required: true,
            type: Boolean
        },
        // rightShow: Boolean
        rightShow: {
            type: Boolean,
            //不传时默认值
            default: true
        }
    }
}

</script>